package priv.mill.mapper;

import javax.servlet.http.HttpServlet;

import priv.mill.mapper.annotation.Select;

@Select(value="select * from employee where id=? and u_age=?",argNames= {"id","u_age"})
public class EmployeeUpdateMapper extends HttpServlet {
//
//	private static Logger logger = Logger.getLogger(EmployeeUpdateMapper.class);
//
//	@Override
//	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
////		?u_id=1&u_phone=18888889999&u_age=18&u_salary=4567.88&jiangjin=34523&d_id=1
//		String uId = req.getParameter("u_id");
//		if(uId==null) {
//			return ;
//		}
//		
//		try {
//			List<Map<String, Object>> query =
//					JdbcUtil.query("select * from employee where id=?", uId);
//			Map<String, Object> map = query.get(0);
////			id | u_name   | u_phone     | u_age | u_salary | jiangjin | d_id
//			if(req.getParameter("u_phone")!=null)map.put("u_phone", req.getParameter("u_phone"));
//			if(req.getParameter("u_name")!=null)map.put("u_name", req.getParameter("u_name"));
//			if(req.getParameter("u_age")!=null)map.put("u_age", req.getParameter("u_age"));
//			if(req.getParameter("u_salary")!=null)map.put("u_salary", req.getParameter("u_salary"));
//			if(req.getParameter("jiangjin")!=null)map.put("jiangjin", req.getParameter("jiangjin"));
//			if(req.getParameter("d_id")!=null)map.put("d_id", req.getParameter("d_id"));
//			JdbcUtil.update("update employee set u_name=?,u_phone=?,u_age=?,u_salary=?,jiangjin=?,d_id=? where id=?", 
//					map.get("u_name"),
//					map.get("u_phone"),
//					map.get("u_age"),
//					map.get("u_salary"),
//					map.get("jiangjin"),
//					map.get("d_id"),
//					uId
//					);
//			
//		} catch (Exception e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		
//	}
//	
//	
//	
}


